'use client';

import { useEffect, useState } from 'react';
import Dashboard from '@/components/dashboard';
import { generateMockData } from '@/lib/data-utils';

interface DashboardData {
  matrix: number[][];
  previousMatrix: number[][];
  achievements: Array<{
    id: string;
    name: string;
    unlocked: boolean;
    progress: number;
  }>;
}

export default function Home() {
  const [data, setData] = useState<DashboardData | null>(null);

  useEffect(() => {
    const fetchData = async () => {
      const result = await generateMockData();
      setData(result);
    };
    fetchData();
  }, []);

  if (!data) {
    return <div>Loading...</div>;
  }

  return <Dashboard data={data} />;
}

